package pcjavanet.mobilesell.web.servlet;

import javax.servlet.Servlet;
import javax.servlet.ServletConfig;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;

import org.springframework.web.context.WebApplicationContext;
import org.springframework.web.context.support.WebApplicationContextUtils;

import pcjavanet.mobilesell.service.LogrecordService;
import pcjavanet.util.LogUtil;

/**
 * Servlet implementation class InitSpringContextServlet
 */
public class InitSpringContextServlet extends HttpServlet {
	private static final long serialVersionUID = 1L;
 
	public void init() throws ServletException {
		super.init();		
		ServletContext application = this.getServletContext();
		WebApplicationContext wac = WebApplicationContextUtils .getWebApplicationContext(application);
		LogrecordService logrecordService =(LogrecordService)wac.getBean("logrecordService");
		LogUtil.setLogrecordService(logrecordService);
	}

}
